﻿#region Imports
using System;
using System.Drawing;
using System.Windows.Forms;
#endregion

namespace BulkRenamer.Controls
{
    /// <summary>
    /// BulkRenamer button (inherited from System.Windows.Forms.Button)
    /// </summary>
    public class BRButton : Button
    {
        #region Properties
        public FontStyle InitialFontStyle { get; set; }
        #endregion

        #region Constructors
        public BRButton()
            : base()
        {
            InitialFontStyle = this.Font.Style;

            this.MouseEnter += new EventHandler(BRButton_MouseEnter);
            this.MouseLeave += new EventHandler(BRButton_MouseLeave);
        }
        #endregion

        #region Formatting events
        private void BRButton_MouseEnter(object sender, EventArgs e)
        {
            Button btn = (Button)sender;
            btn.Font = new Font(btn.Font.FontFamily, btn.Font.Size, FontStyle.Bold, btn.Font.Unit, btn.Font.GdiCharSet);
        }

        private void BRButton_MouseLeave(object sender, EventArgs e)
        {
            Button btn = (Button)sender;
            btn.Font = new Font(btn.Font.FontFamily, btn.Font.Size, InitialFontStyle, btn.Font.Unit, btn.Font.GdiCharSet);
        }
        #endregion
    }
}
